package com.gprinter.http;


import android.util.Log;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;


/**
 * Created by 他的猫 on 2017/5/10.
 */

public class API {

    public static int Q=0;

    public static void Login( String url, Okhttp.Objectcallback handler) {


        Log.e("zzzz", "url:"+url);
        Okhttp.get(url, null,  handler);

    }

    public static void query2(String URL, Okhttp.Objectcallback handler) {
        Okhttp.post(URL, null, handler);
    }
    /**
     * 上传文件  未完成
     *
     * @param file
     * @param handler
     */
    public static void Upload(String url, String fenlujin,  String file, String filename,String panfu, Okhttp.Objectcallback handler) {

        Log.e("zzz", url);
        Map<String, String> map = new HashMap<>();
        map.put("path", fenlujin);
        map.put("panfu", panfu);
        Okhttp.multiFileUpload(url, map, file,filename, handler);

    }
    public static void upLoadToServer(String url, String fenlujin, final ArrayList<String> list , String panfu, Okhttp.Objectcallback handler) {


        Map<String, String> map = new HashMap<>();
        map.put("path", fenlujin);
        map.put("panfu", panfu);
        Okhttp.upLoadToServer(url, map, list, handler);

    }


}

